Versons, builder config, and metadata#1
Merged
Conversation
blakerouse
pushed a commit
that referenced
this pull request
Feb 25, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add `Base64Encode` OTTL converter function to encode strings into base64 format with support for multiple variants (`base64`, `base64-raw`, `base64-url`, `base64-raw-url`). This function addresses the need to handle characters not allowed by certain exporters like NATS Core. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#46071 <!--Describe what testing was performed and which tests were added.--> #### Testing Tested manually and added unit and e2e tests. Test config: ```yaml processors: transform: log_statements: - context: log statements: - set(attributes["encoded_default"], Base64Encode(attributes["plain_text"])) - set(attributes["encoded_base64_raw"], Base64Encode(attributes["plain_text"], "base64-raw")) - set(attributes["encoded_base64_url"], Base64Encode(attributes["plain_text"], "base64-url")) - set(attributes["encoded_base64_raw_url"], Base64Encode(attributes["plain_text"], "base64-raw-url")) ``` Test input: ```json {"plain_text": "test string"} {"plain_text": "hello world"} {"plain_text": "special chars: @#$%"} {"plain_text": "URL encoding test: https://example.com?param=value&other=123"} ``` Test result: ``` LogRecord #0 Body: Str({"plain_text": "test string"}) Attributes: -> log.file.name: Str(test_data.log) -> plain_text: Str(test string) -> encoded_default: Str(dGVzdCBzdHJpbmc=) -> encoded_base64_raw: Str(dGVzdCBzdHJpbmc) -> encoded_base64_url: Str(dGVzdCBzdHJpbmc=) -> encoded_base64_raw_url: Str(dGVzdCBzdHJpbmc) LogRecord #1 Body: Str({"plain_text": "hello world"}) Attributes: -> log.file.name: Str(test_data.log) -> plain_text: Str(hello world) -> encoded_default: Str(aGVsbG8gd29ybGQ=) -> encoded_base64_raw: Str(aGVsbG8gd29ybGQ) -> encoded_base64_url: Str(aGVsbG8gd29ybGQ=) -> encoded_base64_raw_url: Str(aGVsbG8gd29ybGQ) LogRecord open-telemetry#2 Body: Str({"plain_text": "special chars: @#$%"}) Attributes: -> log.file.name: Str(test_data.log) -> plain_text: Str(special chars: @#$%) -> encoded_default: Str(c3BlY2lhbCBjaGFyczogQCMkJQ==) -> encoded_base64_raw: Str(c3BlY2lhbCBjaGFyczogQCMkJQ) -> encoded_base64_url: Str(c3BlY2lhbCBjaGFyczogQCMkJQ==) -> encoded_base64_raw_url: Str(c3BlY2lhbCBjaGFyczogQCMkJQ) LogRecord open-telemetry#3 Body: Str({"plain_text": "URL encoding test: https://example.com?param=value&other=123"}) Attributes: -> log.file.name: Str(test_data.log) -> plain_text: Str(URL encoding test: https://example.com?param=value&other=123) -> encoded_default: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20/cGFyYW09dmFsdWUmb3RoZXI9MTIz) -> encoded_base64_raw: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20/cGFyYW09dmFsdWUmb3RoZXI9MTIz) -> encoded_base64_url: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20_cGFyYW09dmFsdWUmb3RoZXI9MTIz) -> encoded_base64_raw_url: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20_cGFyYW09dmFsdWUmb3RoZXI9MTIz) ``` <!--Describe the documentation added.--> #### Documentation Updated `README.md` with function documentation, usage examples, and supported variants. <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
blakerouse
pushed a commit
that referenced
this pull request
Apr 21, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add support timeout setting for telemetrygen <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#47203 #### Testing Sending traces to a collector that has an artificial delay of `10s` before answering ``` ❯ go run . traces --traces 1 --timeout 5s --otlp-insecure 2026-04-01T17:29:31.673+0300 INFO channelz/trace.go:200 [core] [Channel #1] Channel Connectivity change to READY {"grpc_log": true} 2026/04/01 17:29:34 traces export: context deadline exceeded: rpc error: code = DeadlineExceeded desc = context deadline exceeded 2026-04-01T17:29:34.980+0300 INFO channelz/trace.go:200 [core] [Channel #1] Channel Connectivity change to SHUTDOWN {"grpc_log": true} ``` ``` ❯ go run . traces --traces 1 --timeout 15s --otlp-insecure 2026-04-01T17:30:42.046+0300 INFO channelz/trace.go:200 [core] [Channel #1] Channel Connectivity change to READY {"grpc_log": true} 2026-04-01T17:30:52.052+0300 INFO channelz/trace.go:200 [core] [Channel #1] Channel Connectivity change to SHUTDOWN {"grpc_log": true} ```
blakerouse
pushed a commit
that referenced
this pull request
Apr 21, 2026
…pen-telemetry#45518) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description The `extract_percentile_metric` function creates a new Gauge metric from a Histogram or ExponentialHistogram by calculating the specified percentile value from the bucket counts. A metric will only be created if there is at least one data point. `percentile` is a float64 value between 0 and 100 representing the desired percentile to extract (e.g., 50 for median, 95 for p95, 99 for p99). `suffix` is an optional string that defines the suffix for the metric name. By default, it is set to `_p{percentile}` (e.g., `_p50`, `_p95`, `_p99`). <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Closes open-telemetry#44316 <!--Describe what testing was performed and which tests were added.--> #### Testing Included unit tests and tested manually with this configuration: ``` yaml receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 exporters: debug: verbosity: detailed sampling_initial: 10000 sampling_thereafter: 10000 processors: transform: error_mode: ignore metric_statements: - context: metric statements: - extract_percentile_metric(50.0) - extract_percentile_metric(95.0) - extract_percentile_metric(99.0, "_p99_custom") service: telemetry: metrics: level: none pipelines: metrics: receivers: [otlp] processors: [transform] exporters: - debug ``` tested with `telemetrygen` tool with params to generate regular histogram metrics: ``` ./bin/telemetrygen_darwin_arm64 metrics \ ok | 14:34:29 --otlp-insecure \ --otlp-endpoint localhost:4317 \ --metrics 1 \ --otlp-attributes 'service.name="histogram-service"' \ --metric-type Histogram \ --otlp-metric-name "http.server.duration" ``` Obtained output: ``` Metric #1 Descriptor: -> Name: http.server.duration_p50 -> Description: (p50) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC Value: 137.500000 Metric open-telemetry#2 Descriptor: -> Name: http.server.duration_p95 -> Description: (p95) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC Value: 750.000000 Metric open-telemetry#3 Descriptor: -> Name: http.server.duration_p99_custom -> Description: (p99) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC Value: 750.000000 # p99 is placed in last bucket which is [bucket_lower_bound, + Inf ]. Cannot interpolate with Inf values so it is necessary to use lowerbound (750) ``` Tested with Exponential histogram as well: ``` ./bin/telemetrygen_darwin_arm64 metrics \ ok | 14:42:11 --otlp-insecure \ --otlp-endpoint localhost:4317 \ --metrics 1 \ --otlp-attributes 'service.name="histogram-service"' \ --metric-type ExponentialHistogram \ --otlp-metric-name "http.server.duration" ``` and got the output: ``` Metric #1 Descriptor: -> Name: http.server.duration_p50 -> Description: (p50) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC Value: 545.301038 Metric open-telemetry#2 Descriptor: -> Name: http.server.duration_p95 -> Description: (p95) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC Value: 961.465253 Metric open-telemetry#3 Descriptor: -> Name: http.server.duration_p99_custom -> Description: (p99) -> Unit: -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC Value: 1024.000000 ``` <!--Describe the documentation added.--> #### Documentation Added proper documentation to transform processor `README.md`. <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
blakerouse
pushed a commit
that referenced
this pull request
Apr 21, 2026
…arsing in %Z field (open-telemetry#47767) #### Description Adds a new optional time_zone_locations field to TimeParser that maps timezone abbreviations to IANA location names. This allows correct parsing of log streams that contain timestamps with multiple timezone abbreviations (e.g. IST, PDT, NZST) in a single operator block. Changes: [time.go](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) — added [TimeZoneLocations map[string]string](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) field (mapstructure: time_zone_locations), resolveLocation() method, and a validation that rejects time_zone_locations when the layout contains no %Z/MST directive [time_test.go](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) — added [TestTimeZoneLocations](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html), [TestTimeZoneLocationsErrors](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html), and [TestUnmarshalTimeConfig/time_zone_locations](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) [timestamp.yaml](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) — added time_zone_locations unmarshal fixture [timestamp.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) — documented [location](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) and time_zone_locations fields; added multi-timezone example [time_parser.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) — added [location](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) and time_zone_locations to the configuration fields table #### Link to tracking issue Fixes [47594](open-telemetry#47594) #### Testing Unit tests added and verified existing and new tests are passing. **Manual testing:** **Test log lines used:** ``` Wed Aug 27 15:08:58 IST 2025 Log from India Wed Aug 20 14:08:48 CST 2025 Log from China Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand ``` **Without time_zone_locations param added/old behaviour:** [collector-config.yaml](https://github.com/user-attachments/files/26901647/collector-config.yaml) timeout 15 ./otelcol-tz-test/otelcol-tz-test --config collector-config.yaml 2>&1 | grep -E "LogRecord|Timestamp:|Body:" || true LogRecord #0 ObservedTimestamp: 2026-04-20 14:11:36.028277 +0000 UTC Timestamp: 2025-08-27 09:38:58 +0000 UTC Body: Str(Wed Aug 27 15:08:58 IST 2025 Log from India) LogRecord #1 ObservedTimestamp: 2026-04-20 14:11:36.028279 +0000 UTC Timestamp: 1970-01-01 00:00:00 +0000 UTC Body: Str(Wed Aug 20 14:08:48 CST 2025 Log from China) LogRecord #0 ObservedTimestamp: 2026-04-20 14:11:36.628855 +0000 UTC Timestamp: 1970-01-01 00:00:00 +0000 UTC Body: Str(Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand) NZST and CST are not parsed properly. **With time_zone_locations param configured:** [collector-config.yaml](https://github.com/user-attachments/files/26901658/collector-config.yaml) timeout 15 ./otelcol-tz-test/otelcol-tz-test --config collector-config.yaml 2>&1 | grep -E "LogRecord|Timestamp:|Body:" || true LogRecord #0 ObservedTimestamp: 2026-04-20 14:12:22.096579 +0000 UTC Timestamp: 2025-08-27 09:38:58 +0000 UTC Body: Str(Wed Aug 27 15:08:58 IST 2025 Log from India) LogRecord #1 ObservedTimestamp: 2026-04-20 14:12:22.096582 +0000 UTC Timestamp: 2025-08-20 06:08:48 +0000 UTC Body: Str(Wed Aug 20 14:08:48 CST 2025 Log from China) LogRecord #0 ObservedTimestamp: 2026-04-20 14:12:22.696974 +0000 UTC Timestamp: 2025-07-15 22:00:00 +0000 UTC Body: Str(Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand) All timezone abbreviations are parsed properly into their respective UTC times. #### Documentation Updated [timestamp.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) and [time_parser.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) to document the new time_zone_locations field and add a multi-timezone parsing example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I fixed a couple of issues with open-telemetry#35648. The CI checks will likely turn up more, but this is a start.